package com.example.day22;

/**
 * @author Lenovo
 */
public class Addable {
    int add(int x, int y) {
        return 0;
    }
}
public class AddableDemo {
    public static void main(String[] args) {
        //在主方法中调用useAddable方法
        useAddable((int x,int y) -> {
            return x + y;
        });
    }

private static void useAddable(Addable a) {
    int sum = a.add(10, 20);
    System.out.println(sum);
}
}